﻿<ResourceDictionary xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"  xmlns:outlook="clr-namespace:Silverlight.OutlookBar"  
                    xmlns:system="clr-namespace:System;assembly=mscorlib" 
                    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows" 
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    mc:Ignorable="d">

    <!-- Colours -->
    <SolidColorBrush x:Key="OutlookCaptionBrush" Color="#FF00487A" />
    <SolidColorBrush x:Key="OutlookBarButtonTextBrush" Color="#FF00487A" />
    <SolidColorBrush x:Key="OutlookBarBorderBrush" Color="#FF00487A" />

    
    <LinearGradientBrush x:Key="OutlookHeaderBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFD9EDFF" Offset="0"/>
        <GradientStop Color="#FFB5D7FB" Offset="0.396"/>
        <GradientStop Color="#FF97C7FF" Offset="0.432" />
        <GradientStop Color="#FFC0DBFF" Offset="1"/>
    </LinearGradientBrush>

    
    <LinearGradientBrush x:Key="OutlookFooterBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFD9EDFF" Offset="0"/>
        <GradientStop Color="#FFB5D7FB" Offset="0.396"/>
        <GradientStop Color="#FF97C7FF" Offset="0.432" />
        <GradientStop Color="#FFC0DBFF" Offset="1"/>
    </LinearGradientBrush>
    
    
    <LinearGradientBrush x:Key="OutlookBarNormalBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFD9EDFF" Offset="0"/>
        <GradientStop Color="#FFB5D7FB" Offset="0.396"/>
        <GradientStop Color="#FF97C7FF" Offset="0.432" />
        <GradientStop Color="#FFC0DBFF" Offset="1"/>
    </LinearGradientBrush>

    
    <LinearGradientBrush x:Key="OutlookBarMouseOverBrush" StartPoint="0,0" EndPoint="0,1">
        <GradientStop Color="#FFFEE4" Offset="0"/>
        <GradientStop Color="#FFE8A7" Offset="0.396"/>
        <GradientStop Color="#FFD767" Offset="0.432" />
        <GradientStop Color="#FFE69E" Offset="1"/>
    </LinearGradientBrush>
    
    
    <LinearGradientBrush x:Key="OutlookBarBackgroundBrush" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Color="#FFFFFFFF" Offset="0" />
        <GradientStop Color="#FFFDFEFF"  Offset="1" />
    </LinearGradientBrush>

    
    <LinearGradientBrush x:Key="OutlookGridSplitterBrush" EndPoint="0,1" StartPoint="0,0">
        <GradientStop Color="#FFFDFDFD" Offset="0"/>
        <GradientStop Color="#FFC0DEFF" Offset="0.654"/>
        <GradientStop Color="#FFC0D9FB" Offset="1"/>
    </LinearGradientBrush>
    
    
    <Style x:Key="OutlookDoubleArrowToggleButtonStyle" TargetType="ToggleButton">
        <Setter Property="Background" Value="{StaticResource OutlookBarNormalBrush}" />
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ToggleButton">
                    <Grid x:Name="ToggleButtonGrid" Width="26" Background="{TemplateBinding Background}">
                    	<Grid.Projection>
                    		<PlaneProjection/>
                    	</Grid.Projection>
                		<VisualStateManager.VisualStateGroups>
                			<VisualStateGroup x:Name="CommonStates">
                				<VisualState x:Name="Normal"/>
                				<VisualState x:Name="MouseOver">
                					<Storyboard>
                						<ColorAnimationUsingKeyFrames Duration="00:00:00.001"
                							Storyboard.TargetName="ToggleButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                							<SplineColorKeyFrame KeyTime="0" Value="#FFFEE4" />
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="ToggleButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                							<SplineColorKeyFrame KeyTime="0" Value="#FFE8A7" />
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="ToggleButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                							<SplineColorKeyFrame KeyTime="0" Value="#FFD767" />
                						</ColorAnimationUsingKeyFrames>
                						<ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="ToggleButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                							<SplineColorKeyFrame KeyTime="0" Value="#FFE69E" />
                						</ColorAnimationUsingKeyFrames>
                					</Storyboard>
                				</VisualState>
                				<VisualState x:Name="Pressed"/>
                				<VisualState x:Name="Disabled"/>
                			</VisualStateGroup>
                			<VisualStateGroup x:Name="CheckStates">
                				<VisualState x:Name="Indeterminate"/>
                				<VisualState x:Name="Checked">
                					<Storyboard>
                						<DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="ToggleButtonGrid" d:IsOptimized="True"/>
                						<DoubleAnimation Duration="0" To="180" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)" Storyboard.TargetName="ToggleButtonGrid" d:IsOptimized="True"/>
                					</Storyboard>
                				</VisualState>
                				<VisualState x:Name="Unchecked"/>
                			</VisualStateGroup>
                		</VisualStateManager.VisualStateGroups>
                		<Path RenderTransformOrigin="0.5,0.5" Fill="{x:Null}" Stretch="Fill" Stroke="{StaticResource OutlookBarBorderBrush}" HorizontalAlignment="Stretch" Margin="9.5,11.167,12.083,11" x:Name="path" Width="Auto" Data="M9.9166667,11.666667 L6.499667,15.999667 9.9163337,19.666334">
                			<Path.RenderTransform>
                				<TransformGroup>
                					<ScaleTransform ScaleX="1" ScaleY="1"/>
                					<SkewTransform AngleX="0" AngleY="0"/>
                					<RotateTransform Angle="0"/>
                					<TranslateTransform X="0" Y="0"/>
                				</TransformGroup>
                			</Path.RenderTransform>
                		</Path>
                		<Path Fill="{x:Null}" Stretch="Fill" Stroke="{StaticResource OutlookBarBorderBrush}" Data="M9.9166667,11.666667 L6.499667,15.999667 9.9163337,19.666334" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Margin="0,11.167,8,11" x:Name="path1" Width="4.083">
                			<Path.RenderTransform>
                				<TransformGroup>
                					<ScaleTransform ScaleX="1" ScaleY="1"/>
                					<SkewTransform AngleX="0" AngleY="0"/>
                					<RotateTransform Angle="0"/>
                					<TranslateTransform X="0" Y="0"/>
                				</TransformGroup>
                			</Path.RenderTransform>
                		</Path>
                	</Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <Style x:Key="VerticalButtonStyle" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource OutlookBarNormalBrush}" />
        <Setter Property="Foreground" Value="{StaticResource OutlookBarButtonTextBrush}"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="{StaticResource OutlookBarBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid RenderTransformOrigin="0.5,0.5">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                        <ColorAnimation Duration="0" To="#F2FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#CCFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#7FFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <ColorAnimation Duration="0" To="#FF6DBDD1" Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" Storyboard.TargetName="Background"/>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="BackgroundAnimation"/>
                                        <ColorAnimation Duration="0" To="#D8FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#C6FFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#8CFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[2].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                        <ColorAnimation Duration="0" To="#3FFFFFFF" Storyboard.TargetProperty="(Rectangle.Fill).(GradientBrush.GradientStops)[3].(GradientStop.Color)" Storyboard.TargetName="BackgroundGradient"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To=".55" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="DisabledVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="FocusVisualElement"/>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="White">
                            <Grid Background="{TemplateBinding Background}" Margin="1">
                                <Border x:Name="BackgroundAnimation" Background="#FF448DCA" Opacity="0"/>
                                <Rectangle x:Name="BackgroundGradient" Fill="{TemplateBinding Background}" />
                            </Grid>
                        </Border>
                        <ContentPresenter x:Name="contentPresenter" 
                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                          Content="{TemplateBinding Content}" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          Margin="{TemplateBinding Padding}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                                          RenderTransformOrigin="0.5,0.5" />
                        <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" IsHitTestVisible="false" Opacity="0"/>
                        <Rectangle x:Name="FocusVisualElement" IsHitTestVisible="false" Margin="1" Opacity="0" Stroke="#FF6DBDD1" StrokeThickness="1"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="outlook:OutlookBarFooterTrayButton">
        <Setter Property="Background" Value="{StaticResource OutlookBarNormalBrush}" />
        <Setter Property="Foreground" Value="{StaticResource OutlookBarButtonTextBrush}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="outlook:OutlookBarFooterTrayButton">
                    <Grid x:Name="TrayButtonGrid" Width="24" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001"
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFFEE4" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE8A7" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFD767" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE69E" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="contentPresenter" 
                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                          Content="{TemplateBinding Content}" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          Margin="{TemplateBinding Padding}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <Style x:Key="ConfigureButton" TargetType="Button">
        <Setter Property="Background" Value="{StaticResource OutlookBarNormalBrush}" />
        <Setter Property="Foreground" Value="{StaticResource OutlookBarButtonTextBrush}"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Padding" Value="3"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid x:Name="TrayButtonGrid" Width="24" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal"/>
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001"
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFFEE4" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE8A7" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFD767" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" 
                							Storyboard.TargetName="TrayButtonGrid"
                							Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE69E" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed" />
                                <VisualState x:Name="Disabled" />
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused" />
                                <VisualState x:Name="Unfocused"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter x:Name="contentPresenter" 
                                          ContentTemplate="{TemplateBinding ContentTemplate}" 
                                          Content="{TemplateBinding Content}" 
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" 
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          Margin="{TemplateBinding Padding}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!-- OutlookBarButton -->
    <Style x:Key="OutlookBarButton" TargetType="outlook:OutlookBarButton">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Background" Value="{StaticResource OutlookBarNormalBrush}" />
        <Setter Property="Foreground" Value="{StaticResource OutlookBarButtonTextBrush}" />
        <Setter Property="BorderBrush"  Value="{StaticResource OutlookBarBorderBrush}" />
        <Setter Property="BorderThickness" Value="0.5" />
        <Setter Property="Height" Value="30" />
        <Setter Property="MinHeight" Value="30" />
        <Setter Property="Cursor" Value="Hand" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="outlook:OutlookBarButton">
                    <Grid x:Name="OutlookBarButtonGrid" Background="{TemplateBinding Background}" Height="{TemplateBinding Height}" MinHeight="{TemplateBinding MinHeight}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001"
                                                                      Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFFEE4" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE8A7" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFD767" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFE69E" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Disabled" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused" />
                                <vsm:VisualState x:Name="Unfocused" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ExpansionStates">
                                <vsm:VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="theOutlookBarButtonContentPresenter" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="theOutlookBarButtonContentPresenter" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFD9AA" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFBB6E" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[2].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FFAB3F" />
                                        </ColorAnimationUsingKeyFrames>
                                        <ColorAnimationUsingKeyFrames Duration="00:00:00.001" Storyboard.TargetName="OutlookBarButtonGrid"
                                                                      Storyboard.TargetProperty="(UIElement.Background).(GradientBrush.GradientStops)[3].(GradientStop.Color)">
                                            <SplineColorKeyFrame KeyTime="0" Value="#FEE17A" />
                                        </ColorAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unselected" />
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                            <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Margin="5,0,0,0">
                                <Image x:Name="theOutlookBarButtonImage" Source="{TemplateBinding HeaderImage}" Width="24" Height="24" Margin="2,0,2,0" HorizontalAlignment="Left" VerticalAlignment="Center" />
                                <ContentPresenter x:Name="theOutlookBarButtonContentPresenter" 
                                                  Margin="5,0,5,0" 
                                                  Content="{TemplateBinding Header}" 
                                                  VerticalAlignment="Center" />
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!-- OutlookBar -->
    <Style TargetType="outlook:OutlookBar">
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Background" Value="{StaticResource OutlookBarBackgroundBrush}" />
        <Setter Property="BorderBrush" Value="{StaticResource OutlookBarBorderBrush}" />
        <Setter Property="BorderThickness" Value="1" />
        <Setter Property="Padding" Value="5" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="FontSize" Value="12" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource OutlookBarButton}" />
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <StackPanel x:Name="OutlookBarStackPanel" Orientation="Vertical" Height="Auto" Margin="0,10,0,0" />
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="IsExpanded" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="outlook:OutlookBar">
                    <Border x:Name="OutlookBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver" />
                                <vsm:VisualState x:Name="Disabled" />
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ExpansionStates">
                                <vsm:VisualState x:Name="Expanded" />
                                <vsm:VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="VerticalButton" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="theOutlookBarContentPresenter" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="InternalControlTemplateGrid" Storyboard.TargetProperty="Width" Duration="0">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="34"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="InternalControlTemplateGrid" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="HeaderTextBlock" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="OutlookBorder" Storyboard.TargetProperty="Width" Duration="0">
                                            <SplineDoubleKeyFrame KeyTime="0" Value="34"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="OutlookBorder" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Left" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Grid x:Name="ControlTemplateGrid">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="30" />
                                <RowDefinition Height="*" />
                                <RowDefinition Height="30" />
                            </Grid.RowDefinitions>
                            <Grid Grid.Row="0" Height="30" Background="{StaticResource OutlookHeaderBrush}" HorizontalAlignment="Stretch">
                                <TextBlock x:Name="HeaderTextBlock" HorizontalAlignment="Left" VerticalAlignment="Center" TextWrapping="Wrap"
                                            Text="{TemplateBinding Header}"
                                            FontSize="18" FontWeight="Bold" Margin="10,0,0,0" Foreground="{StaticResource OutlookCaptionBrush}"
                                           Visibility="Visible"/>
                                <ToggleButton x:Name="theOutlookToggleButton" HorizontalAlignment="Right" Width="28" Height="28" Style="{StaticResource OutlookDoubleArrowToggleButtonStyle}" />
                            </Grid>
                            <Grid x:Name="InternalControlTemplateGrid" Visibility="Visible" Grid.Row="1" HorizontalAlignment="Stretch">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*" />
                                    <RowDefinition Height="Auto" MinHeight="10" MaxHeight="{Binding ElementName=theOutlookBarButtonsPresenter, Path=ActualHeight}" />
                                </Grid.RowDefinitions>
                                <ContentPresenter x:Name="theOutlookBarContentPresenter" Grid.Row="0" 
                                                    Content="{TemplateBinding SelectedContent}"
                                                    FlowDirection="{TemplateBinding FlowDirection}" 
                                                    Opacity="{TemplateBinding Opacity}" 
                                                    Visibility="Visible"/>
                                <Button x:Name="VerticalButton" Visibility="Collapsed" Width="34" Height="Auto" Style="{StaticResource VerticalButtonStyle}" VerticalAlignment="Stretch" HorizontalAlignment="Left" Grid.Row="0" />
                                <outlook:OutlookBarGridSplitter x:Name="theOutlookBarGridSplitter" DragIncrement="30" Background="{StaticResource OutlookGridSplitterBrush}" Grid.Row="1" Height="10" HorizontalAlignment="Stretch" Margin="0" VerticalAlignment="Top"/>
                                <ItemsPresenter x:Name="theOutlookBarButtonsPresenter" Visibility="Visible" VerticalAlignment="Top" Grid.Row="1" />
                            </Grid>
                            <Grid Grid.Row="2" Height="30" Background="{StaticResource OutlookFooterBrush}" HorizontalAlignment="Stretch">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="34" />
                                </Grid.ColumnDefinitions>
                                <StackPanel x:Name="theOutlookBarFooterTrayStackPanel" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Right" />
                                <Button x:Name="theConfigureButton" Grid.Column="1" Style="{StaticResource ConfigureButton}">
                                    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                                        <Path Data="M116,112 L69,45 L164,45 z" Fill="{StaticResource OutlookBarBorderBrush}" Margin="5, 10" Stretch="Fill" Stroke="{StaticResource OutlookBarBorderBrush}" UseLayoutRounding="False"/>
                                    </Grid>
                                </Button>
                            </Grid>
                        </Grid>
                    </Border>
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    
    <!-- OutlookBarGridSplitter -->
    <Style TargetType="outlook:OutlookBarGridSplitter">
        <Setter Property="Background" Value="#FFFFFFFF"/>
        <Setter Property="IsTabStop" Value="true"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="PreviewStyle">
            <Setter.Value>
                <Style TargetType="Control">
                    <Setter Property="Background" Value="#FF868686"/>
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate TargetType="Control">
                                <Grid x:Name="Root" Opacity=".5">

                                    <!-- Background -->
                                    <Rectangle Fill="{TemplateBinding Background}" />

                                    <!-- Horizontal Template -->
                                    <Grid x:Name="HorizontalTemplate" Height="6">
                                        <!-- Just show the faint gray grid splitter rectangle with no other details -->
                                    </Grid>

                                    <!-- Vertical Template -->
                                    <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="6">
                                        <!-- Just show the faint gray grid splitter rectangle with no other details -->
                                    </Grid>

                                </Grid>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="outlook:OutlookBarGridSplitter">
                    <Grid x:Name="Root" IsHitTestVisible="{TemplateBinding IsEnabled}">

                        <!-- VSM -->
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver" />
                                <vsm:VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Root" Storyboard.TargetProperty="Opacity" To="0.5" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Unfocused" />
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Opacity" To="1" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <!-- Background -->
                        <Rectangle Fill="{TemplateBinding Background}" StrokeThickness="0" />

                        <!-- Horizontal Template -->
                        <Grid x:Name="HorizontalTemplate" Height="10">
                            <StackPanel Height="6" VerticalAlignment="Center">
                                <Rectangle Height="1" Margin="1" Width="10" StrokeThickness="0" Fill="#FF868686" />
                                <Rectangle Height="1" Margin="1" Width="10" StrokeThickness="0" Fill="#FF868686" />
                            </StackPanel>
                        </Grid>

                        <!-- Vertical Template -->
                        <Grid x:Name="VerticalTemplate" Visibility="Collapsed" Width="10">
                            <StackPanel Width="6" VerticalAlignment="Center" Orientation="Horizontal">
                                <Rectangle Width="1" Margin="1" Height="10" StrokeThickness="0" Fill="#FF868686" />
                                <Rectangle Width="1" Margin="1" Height="10" StrokeThickness="0" Fill="#FF868686" />
                            </StackPanel>
                        </Grid>

                        <!-- Focus Visual -->
                        <Rectangle x:Name="FocusVisual" Stroke="#FF6DBDD1" StrokeThickness="1" Opacity="0" IsHitTestVisible="false" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    
</ResourceDictionary>
